﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Domain.Models
{
    [DisplayName("员工")]
    public class Employee : BaseEntity
    {
        [DisplayName("编号")]
        public int Id { get; set; }

        [DisplayName("员工名")]
        [Required(ErrorMessage = "员工姓名不能为空")]
        [StringLength(100)]
        public string Name { get; set; }

        [DisplayName("员工号")]
        [StringLength(100)]
        public string EmployeeNo { get; set; }

        [DisplayName("联系方式")]
        [StringLength(50)]
        public string Contact { get; set; }

        [DisplayName("性别")]
        [DefaultValue(Gender.UnKnown)]
        public Gender Gender { get; set; }

        [DisplayName("员工公司")]
        public virtual Company Company { get; set; } = new Company();

        [DisplayName("部门编号")]
        public int DepartmentId { get; set; }

        [DisplayName("所在部门")]
        public virtual Department Department { get; set; } = new Department();
    }
}
